<?php $this->import('Header') ?>
<div class="container">
	<div id="carousel-top" class="carousel slide" data-ride="carousel">
		<!-- Indicators -->
		<ol class="carousel-indicators">
			<li data-target="#carousel-top" data-slide-to="0" class="active"></li>
			<li data-target="#carousel-top" data-slide-to="1"></li>
		</ol>
		<!-- Wrapper for slides -->
		<div class="carousel-inner" role="listbox">
			<div class="item active">
				<img src="/Resource/images/xq.jpg" alt="">
				<div class="carousel-caption"></div>
			</div>
			<div class="item">
				<img src="/Resource/images/test2.jpg" alt="">
				<div class="carousel-caption"></div>
			</div>
			<span class="text-danger" style="font-size: 18px">相亲达狗</span>
		</div>
		<!-- Controls -->
		<a class="left carousel-control" href="#carousel-top" role="button" data-slide="prev">
			<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
			<span class="sr-only">Previous</span>
		</a>
		<a class="right carousel-control" href="#carousel-top" role="button" data-slide="next">
			<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
			<span class="sr-only">Next</span>
		</a>
	</div>
</div>
<div class="container">
	<div class="row">
		<div class="col-xs-8">
			<div class="well well-sm dog-info">
				<p class="bg-title title">
					<span><?php
						$title = '';
						if ($cityInfo) {
							$title .= '在' . implode('', $cityInfo) . '中';
						}
						$title .= '找到' . $breed;
						if ($sex == 1) {
							$title .= 'GG';
						} else if ($sex == 2){
							$title .= 'MM';
						}
						$title .= $pager->count . '个';
						echo $title;
						?></span>
				</p>
				<div class="photo-box">
					<div class="list">
						<?php foreach($dogs as $user) { ?>
							<div class="item">
								<a href="/dog_u<?php echo $user['UserId'] ?>.html"><img src="<?php echo !empty($user['Photo']) ? \Util\User::getUserPhoto($user['Photo'], 200, 200) : '/Resource/images/nohead_new.jpg'; ?>" /></a>
								<div class="info">
									<span class="t">我叫：</span>
									<span class="v"><?php echo $user['Username'] ?></span><br />
									<span class="t">我是：</span>
									<span class="v"><?php echo $user['breedName'] ?></span><br />
									<span class="t">性别：</span>
									<span class="v"><?php echo $user['Sex'] == '1' ? 'GG' : 'MM' ?></span>&nbsp;&nbsp;
									<span class="t">狗龄：</span>
									<span class="v"><?php echo \Util\User::getOld($user['Birthday']) ?></span><br />
									<span class="t">家乡：</span>
									<span class="v"><?php echo $user['cityInfo'] ? implode('', $user['cityInfo']) : '-' ?></span>
								</div>
							</div>
						<?php } ?>
					</div>
				</div>
			</div>
		</div>
		<div class="col-xs-4">
			<div class="condition">
				<form id="js-search-form">
					<input name="city" type="hidden" value="<?php echo $city ?>" />
					<input name="page" type="hidden" value="1" />
					<span class="text-title text-danger">狗狗快速匹配 <i class="glyphicon glyphicon-heart"></i></span>
					<div class="city"><div class="ct">地区</div><div id="js-city"></div></div>
					<div class="clearfix"></div>
					<span class="ct">我想找</span><input name="breed" id="js-input-breed" class="ci form-control" value="<?php echo $breed ?>" placeholder="选择品种" />
					<div class="clearfix"></div>
					<span class="ct">性别</span>
					<span class="ci">
						<label><input name="sex" type="radio" value="3" checked /> 不限</label> &nbsp;&nbsp;&nbsp;&nbsp;
						<label><input name="sex" type="radio" <?php echo $sex == 1 ? 'checked' : '' ?> value="1" /> GG</label> &nbsp;&nbsp;&nbsp;&nbsp;
						<label><input name="sex" type="radio" <?php echo $sex == 2 ? 'checked' : '' ?> value="2" /> MM</label>
					</span>
					<div class="clearfix"></div>
					<div class="btn-g">
						<a href="#" class="btn btn-default">高级搜索</a>
						<button type="submit" class="btn btn-danger">开始配对</button>
					</div>
				</form>
			</div>
			<div class="left-info">
				<p class="tit">快看单身狗</p>
				<?php foreach ($articles as $article) { ?>
					<div class="item">
						<a class="img-a" href="/single/detail_<?php echo $article['ArticleId'] ?>.html"><img src="<?php echo $article['Cover'] ?>" /></a>
						<div class="text">
							<a href="/single/detail_<?php echo $article['ArticleId'] ?>.html" title="<?php echo $article['Title'] ?>"><?php echo \Util\Comm::truncate($article['Title'], 30) ?></a>
							<p>阅读：<span class="text-danger"><?php echo $article['ViewNumber'] ?></span></p>
							<p>评论：<span class="text-danger"><?php echo $article['CommentsNumber'] ?></span></p>
							<p>日期：<span class="text-danger"><?php echo date('Y-m-d', $article['CreateTime']); ?></span></p>
						</div>
					</div>
				<?php } ?>
			</div>
		</div>
	</div>
</div>
<?php $this->import('Footer') ?>
<script>
	seajs.init();
</script>